# -*- coding: utf-8 -*-

import psutil


class Config(object):
    ''' get config from mysql'''
    def __init__(self):
        pass

    def __query_base(self):
        pass
    
    def __query_symbols(self):
        pass
    
    def getip(netname = 'eth0'):
        devices  = psutil.net_if_addrs()
        device = devices.get(netname)
        ipv4 = ''
        if(device is None):
            return ipv4
        for sin in device:
            if 2 == sin.family.value:
                ipv4 = snic.address
        return ipv4 


    def get(self, section, key):
        ''' get value from section.key'''
        return self.__section[section].get(key)

    def getsymbols(self, exchange):
        ''' query symbols from exchange'''
        select * from vic.vic_symbols where exchange=''



